library(cowplot)
dev.new(width=5,height=4,noRStudioGD = TRUE)

SaveSixPlots <- function(Metric="NULL",filetype=".pdf"){
    dir.create(Metric)
    title1 <-paste(Metric, "-1-Condition",filetype, sep = "", collapse=NULL)
    title2 <-paste(Metric, "-2-Gender",filetype, sep = "", collapse=NULL)
    title3 <-paste(Metric, "-3-ComputerGames",filetype, sep = "", collapse=NULL)
    title4 <-paste(Metric, "-4-YearsDriversLicence",filetype, sep = "", collapse=NULL)
    title5 <-paste(Metric, "-5-SimulatorExperience",filetype, sep = "", collapse=NULL)
    title6 <-paste(Metric, "-6-Automatic",filetype, sep = "", collapse=NULL)
  
    ggsave(filename=title1,plot=plot1, path = Metric)
    ggsave(filename=title2,plot=plot2, path = Metric)
    ggsave(filename=title3,plot=plot3, path = Metric)
    ggsave(filename=title4,plot=plot4, path = Metric)
    ggsave(filename=title5,plot=plot5, path = Metric)
    ggsave(filename=title6,plot=plot6, path = Metric)
    
    plot1
    plot2
    plot3
    plot4
    plot5
    plot6
}

Introduction

A study on driving performance and In Vehicle infotainment system has been done. The study aims two answer two questions. 1) Can the addition of tactile navigation improve driving performance 2) Which tactile navigation (if any) improves driving performance most

The first part of this statistical analysis aims to investigate the sample to answer if the data is normally distributed and if the participants’s characteristics are distributed across the four conditions. If this is not the case an effect of condition could be attributed to other personal factors of the participants (e.g. gaming experience).

Independent variable: Condition (Acrylic, Bar, Combination & Touch only)

Metrics: SUS, SART, Glance Time, Total Glances, Lane Breaks, Total Crash.

Demographics: Gender, Age, Gaming experience, Driving experience, Simulator experience, Car games experience, Automatic gear expereience

Population

A summary of ‘Age’ and ‘Years with drivers licence’. As with the bar graph for age we have a lot of people between 20-23 and most participants have had a drivers licence for 3-5 years.

##       Age       YearDriversLicence
##  Min.   :20.0   Min.   : 1.833    
##  1st Qu.:21.0   1st Qu.: 3.479    
##  Median :22.0   Median : 4.417    
##  Mean   :22.7   Mean   : 4.778    
##  3rd Qu.:23.0   3rd Qu.: 5.417    
##  Max.   :34.0   Max.   :16.000
## [1] 2.575191
## [1] 2.418032

Effect due to condition

To answer the first question of whether condition have an effect on the 6 metrics we’ll create a plot of means with confidence (95%) as whiskers. According to Geoff Cumming and Sue Finch if the data has the same standard deviation it is possible to gain insight into which data could be significantly different.

Plot of means Condition/metric

##     Condition  N      SUS       sd       se       ci
## 1     Acrylic 11 80.68182 11.12940 3.355642 7.476835
## 2         Bar 11 80.90909 11.36182 3.425717 7.632973
## 3 Combination 11 80.45455 12.23817 3.689946 8.221712
## 4  Touch_only 11 75.00000 14.23025 4.290582 9.560012

##     Condition  N     SART       sd       se       ci
## 1     Acrylic 11 15.00000 5.253570 1.584011 3.529396
## 2         Bar 11 14.72727 3.951985 1.191568 2.654979
## 3 Combination 11 14.54545 3.643175 1.098459 2.447519
## 4  Touch_only 11 14.00000 4.427189 1.334848 2.974226

##     Condition  N Total_crash        sd        se        ci
## 1     Acrylic 11   0.5454545 0.9341987 0.2816715 0.6276032
## 2         Bar 11   0.6363636 0.8090398 0.2439347 0.5435204
## 3 Combination 11   0.4545455 0.5222330 0.1574592 0.3508409
## 4  Touch_only 11   0.5454545 0.9341987 0.2816715 0.6276032

##     Condition  N Lane_Breaks       sd        se       ci
## 1     Acrylic 11    3.636364 3.074824 0.9270945 2.065695
## 2         Bar 11    4.454545 4.590504 1.3840890 3.083943
## 3 Combination 11    3.909091 2.625054 0.7914836 1.763535
## 4  Touch_only 11    3.818182 2.750207 0.8292185 1.847614

##     Condition  N Total_Glances        sd       se       ci
## 1     Acrylic 11      45.27273 12.042350 3.630905 8.090160
## 2         Bar 11      47.18182  6.274045 1.891696 4.214961
## 3 Combination 11      55.00000 13.798551 4.160420 9.269992
## 4  Touch_only 11      45.27273  7.156688 2.157823 4.807928

##     Condition  N Total_Glance_time        sd       se       ci
## 1     Acrylic 11          34.18545 10.471866 3.157387 7.035096
## 2         Bar 11          34.71636  7.799066 2.351507 5.239484
## 3 Combination 11          40.01091 10.989521 3.313465 7.382861
## 4  Touch_only 11          38.80273 10.009391 3.017945 6.724400

To test significance we will use ANOVA ANOVA has Three assumptions 1) Normality 2) Homogenity 3) Man måler på independent variabel eller sådan noget jeg kan ikke lige huske det

Test of normality - Condition/metric

Cond1 <- subset(SartSusDemo, SartSusDemo$Condition=='Combination')
Cond2 <- subset(SartSusDemo, SartSusDemo$Condition=='Touch_only')
Cond3 <- subset(SartSusDemo, SartSusDemo$Condition=='Bar')
Cond4 <- subset(SartSusDemo, SartSusDemo$Condition=='Acrylic')

  shapiro.test(Cond1$SUS)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond1$SUS
## W = 0.73925, p-value = 0.001505
  shapiro.test(Cond2$SUS)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond2$SUS
## W = 0.91515, p-value = 0.2803
  shapiro.test(Cond3$SUS)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond3$SUS
## W = 0.92941, p-value = 0.4049
  shapiro.test(Cond4$SUS)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond4$SUS
## W = 0.87781, p-value = 0.09759
  shapiro.test(Cond1$SART)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond1$SART
## W = 0.92912, p-value = 0.4021
  shapiro.test(Cond2$SART)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond2$SART
## W = 0.83396, p-value = 0.02632
  shapiro.test(Cond3$SART)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond3$SART
## W = 0.96283, p-value = 0.8064
  shapiro.test(Cond4$SART)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond4$SART
## W = 0.98203, p-value = 0.9764
  shapiro.test(Cond1$Total_Glance_time)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond1$Total_Glance_time
## W = 0.94149, p-value = 0.5381
  shapiro.test(Cond2$Total_Glance_time)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond2$Total_Glance_time
## W = 0.92679, p-value = 0.3793
  shapiro.test(Cond3$Total_Glance_time)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond3$Total_Glance_time
## W = 0.95557, p-value = 0.7155
  shapiro.test(Cond4$Total_Glance_time)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond4$Total_Glance_time
## W = 0.91494, p-value = 0.2787
  shapiro.test(Cond1$Total_Glances)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond1$Total_Glances
## W = 0.97154, p-value = 0.9016
  shapiro.test(Cond2$Total_Glances)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond2$Total_Glances
## W = 0.84398, p-value = 0.03561
  shapiro.test(Cond3$Total_Glances)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond3$Total_Glances
## W = 0.91694, p-value = 0.294
  shapiro.test(Cond4$Total_Glances)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond4$Total_Glances
## W = 0.94695, p-value = 0.6053
  shapiro.test(Cond1$Lane_Breaks)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond1$Lane_Breaks
## W = 0.95245, p-value = 0.6754
  shapiro.test(Cond2$Lane_Breaks)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond2$Lane_Breaks
## W = 0.95583, p-value = 0.7188
  shapiro.test(Cond3$Lane_Breaks)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond3$Lane_Breaks
## W = 0.84061, p-value = 0.03216
  shapiro.test(Cond4$Lane_Breaks)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond4$Lane_Breaks
## W = 0.90516, p-value = 0.2135
  shapiro.test(Cond1$Total_crash)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond1$Total_crash
## W = 0.64917, p-value = 0.0001052
  shapiro.test(Cond2$Total_crash)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond2$Total_crash
## W = 0.64952, p-value = 0.0001063
  shapiro.test(Cond3$Total_crash)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond3$Total_crash
## W = 0.75438, p-value = 0.002371
  shapiro.test(Cond4$Total_crash)
## 
##  Shapiro-Wilk normality test
## 
## data:  Cond4$Total_crash
## W = 0.64952, p-value = 0.0001063

There are 8 scores which break normality
Condition 1 - SUS (0.001505)
Condition 2 - SART (0.02632)
Condition 2 - Total Glances (0.03561)
Condition 3 - Lane breaks (0.03216)

Condition 1 - Total Crash (0.0001052)
Condition 2 - Total Crash (0.0001063)
Condition 3 - Total Crash (0.002371)
Condition 4 - Total Crash (0.0001063)

Another way to present the crash data would be to score crashes pr condition: It can be seen on this graph that each condition has about the same total crashes and some conditions have one or two participants responsible for extra crashes.

Test of homogeneity - Condition/metric

To test for homogeneity we’ll use Levines test for the scores which aren’t normally distributed and Bartletts test for the scores which are normally distributed.

## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.2143 0.8859
##       40
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.4316 0.7315
##       40
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value  Pr(>F)  
## group  3  2.3109 0.09079 .
##       40                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Bartlett test of homogeneity of variances
## 
## data:  Total_Glance_time by Condition
## Bartlett's K-squared = 1.2274, df = 3, p-value = 0.7464
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.0907 0.9647
##       40
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value Pr(>F)
## group  3  0.4612 0.7109
##       40

We see that the variance in metrics across the four conditions are not significantly different.

library("car")
qqPlot(SartSusDemo$SUS)

## [1] 13 42
qqPlot(SartSusDemo$SART)

## [1] 17 35
qqPlot(SartSusDemo$Total_Glance_time)

## [1] 1 3
qqPlot(SartSusDemo$Total_Glances)

## [1]  6 36
qqPlot(SartSusDemo$Total_crash)

## [1] 17 22
qqPlot(SartSusDemo$Lane_Breaks)

## [1] 34 27

Sammenhæng SART og SUS

## 
## Call:
## lm(formula = SUS ~ SART, data = SartSusDemo)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -32.996  -5.397   2.363   8.879  14.863 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  74.0183     6.6602  11.114 4.37e-14 ***
## SART          0.3599     0.4395   0.819    0.417    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 12.17 on 42 degrees of freedom
## Multiple R-squared:  0.01572,    Adjusted R-squared:  -0.00772 
## F-statistic: 0.6706 on 1 and 42 DF,  p-value: 0.4175

Plot of means - All Dependent variables vs All Independent variables

Dependent variables: SUS - SART - Total Crash - Lane Breaks - Total Glances - Total Glance Time Independent variables: Condition - Gender - Gaming - Drivers licence - Automatic gear - Car Simulator

SUS

##     Condition  N      SUS       sd       se       ci
## 1     Acrylic 11 80.68182 11.12940 3.355642 7.476835
## 2         Bar 11 80.90909 11.36182 3.425717 7.632973
## 3 Combination 11 80.45455 12.23817 3.689946 8.221712
## 4  Touch_only 11 75.00000 14.23025 4.290582 9.560012
##   Gender  N      SUS       sd       se       ci
## 1      F 10 77.75000 12.88033 4.073116 9.214030
## 2      M 34 79.70588 12.05676 2.067717 4.206802
##   ComputerGames  N      SUS       sd       se       ci
## 1           0-2 19 81.18421 11.00405 2.524503 5.303784
## 2           3-5 13 75.19231 12.39378 3.437416 7.489486
## 3            5+ 12 80.62500 13.44708 3.881837 8.543865
##    YearDriversLicence N      SUS        sd        se        ci
## 1            1.833333 1 85.00000        NA        NA       NaN
## 2            2.000000 3 85.00000  4.330127  2.500000  10.75663
## 3            2.416667 1 57.50000        NA        NA       NaN
## 4            2.666667 1 90.00000        NA        NA       NaN
## 5            2.833333 1 87.50000        NA        NA       NaN
## 6            3.000000 2 90.00000  7.071068  5.000000  63.53102
## 7            3.333333 1 85.00000        NA        NA       NaN
## 8            3.416667 1 90.00000        NA        NA       NaN
## 9            3.500000 1 82.50000        NA        NA       NaN
## 10           4.000000 7 75.71429 11.430431  4.320297  10.57139
## 11           4.250000 1 85.00000        NA        NA       NaN
## 12           4.416667 3 80.00000  5.000000  2.886751  12.42069
## 13           4.500000 2 83.75000 12.374369  8.750000 111.17929
## 14           4.666667 1 80.00000        NA        NA       NaN
## 15           5.000000 6 83.33333  8.465617  3.456074   8.88412
## 16           5.416667 3 68.33333 20.207259 11.666667  50.19762
## 17           5.916667 1 65.00000        NA        NA       NaN
## 18           6.000000 2 81.25000 19.445436 13.750000 174.71032
## 19           6.083333 1 87.50000        NA        NA       NaN
## 20           6.666667 1 47.50000        NA        NA       NaN
## 21           7.000000 1 60.00000        NA        NA       NaN
## 22           9.000000 1 70.00000        NA        NA       NaN
## 23          10.166667 1 90.00000        NA        NA       NaN
## 24          16.000000 1 85.00000        NA        NA       NaN
##   SimulatorExperience  N      SUS       sd       se       ci
## 1                  No 34 79.70588 12.15064 2.083818 4.239560
## 2                 Yes 10 77.75000 12.55267 3.969502 8.979637
##   Automatic  N      SUS       sd       se       ci
## 1        No 13 78.07692 13.96252 3.872506 8.437465
## 2       Yes 31 79.75806 11.48105 2.062058 4.211283
  SaveSixPlots("SUS")

Sart

##     Condition  N     SART       sd       se       ci
## 1     Acrylic 11 15.00000 5.253570 1.584011 3.529396
## 2         Bar 11 14.72727 3.951985 1.191568 2.654979
## 3 Combination 11 14.54545 3.643175 1.098459 2.447519
## 4  Touch_only 11 14.00000 4.427189 1.334848 2.974226
# Use 95% confidence interval instead of SEM
plot1 <- ggplot(tgc, aes(x=Condition, y=SART, colour=Condition)) + 
    geom_errorbar(aes(ymin=SART-ci, ymax=SART+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   Gender  N     SART       sd       se       ci
## 1      F 10 12.10000 3.510302 1.110055 2.511119
## 2      M 34 15.29412 4.181702 0.717156 1.459065
# Use 95% confidence interval instead of SEM
plot2 <- ggplot(tgc, aes(x=Gender, y=SART, colour=Gender)) + 
    geom_errorbar(aes(ymin=SART-ci, ymax=SART+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   ComputerGames  N     SART       sd       se       ci
## 1           0-2 19 14.26316 4.369619 1.002459 2.106089
## 2           3-5 13 13.84615 3.996794 1.108511 2.415238
## 3            5+ 12 15.83333 4.302924 1.242147 2.733947
# Use 95% confidence interval instead of SEM
plot3 <- ggplot(tgc, aes(x=ComputerGames, y=SART, colour=ComputerGames)) + 
    geom_errorbar(aes(ymin=SART-ci, ymax=SART+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##    YearDriversLicence N     SART        sd       se        ci
## 1            1.833333 1 15.00000        NA       NA       NaN
## 2            2.000000 3 18.00000 2.0000000 1.154701  4.968275
## 3            2.416667 1  4.00000        NA       NA       NaN
## 4            2.666667 1 17.00000        NA       NA       NaN
## 5            2.833333 1 12.00000        NA       NA       NaN
## 6            3.000000 2 17.50000 0.7071068 0.500000  6.353102
## 7            3.333333 1 25.00000        NA       NA       NaN
## 8            3.416667 1 12.00000        NA       NA       NaN
## 9            3.500000 1 19.00000        NA       NA       NaN
## 10           4.000000 7 13.42857 3.2071349 1.212183  2.966105
## 11           4.250000 1 13.00000        NA       NA       NaN
## 12           4.416667 3 11.33333 3.0550505 1.763834  7.589166
## 13           4.500000 2 16.50000 0.7071068 0.500000  6.353102
## 14           4.666667 1 15.00000        NA       NA       NaN
## 15           5.000000 6 16.00000 4.1472883 1.693123  4.352312
## 16           5.416667 3 10.00000 4.0000000 2.309401  9.936551
## 17           5.916667 1 18.00000        NA       NA       NaN
## 18           6.000000 2 13.50000 6.3639610 4.500000 57.177921
## 19           6.083333 1 17.00000        NA       NA       NaN
## 20           6.666667 1 18.00000        NA       NA       NaN
## 21           7.000000 1 18.00000        NA       NA       NaN
## 22           9.000000 1  9.00000        NA       NA       NaN
## 23          10.166667 1 14.00000        NA       NA       NaN
## 24          16.000000 1 12.00000        NA       NA       NaN
  #Use 95% confidence interval instead of SEM
  plot4 <- ggplot(tgc, aes(x=YearDriversLicence, y=SART, colour=YearDriversLicence)) + 
      geom_errorbar(aes(ymin=SART-ci, ymax=SART+ci), width=.1, position=pd) +
      geom_line(position=pd) +
      geom_point(position=pd)
##   SimulatorExperience  N     SART       sd        se       ci
## 1                  No 34 14.47059 4.453363 0.7637455 1.553852
## 2                 Yes 10 14.90000 3.510302 1.1100551 2.511119
# Use 95% confidence interval instead of SEM
plot5 <- ggplot(tgc, aes(x=SimulatorExperience, y=SART, colour=SimulatorExperience)) + 
    geom_errorbar(aes(ymin=SART-ci, ymax=SART+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   Automatic  N     SART       sd        se       ci
## 1        No 13 14.38462 4.908130 1.3612704 2.965953
## 2       Yes 31 14.64516 3.987885 0.7162453 1.462768
# Use 95% confidence interval instead of SEM
plot6 <- ggplot(tgc, aes(x=Automatic, y=SART, colour=Automatic)) + 
    geom_errorbar(aes(ymin=SART-ci, ymax=SART+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
  SaveSixPlots("SART")

### Total crash

##     Condition  N Total_crash        sd        se        ci
## 1     Acrylic 11   0.5454545 0.9341987 0.2816715 0.6276032
## 2         Bar 11   0.6363636 0.8090398 0.2439347 0.5435204
## 3 Combination 11   0.4545455 0.5222330 0.1574592 0.3508409
## 4  Touch_only 11   0.5454545 0.9341987 0.2816715 0.6276032
# Use 95% confidence interval instead of SEM
plot1 <- ggplot(tgc, aes(x=Condition, y=Total_crash, colour=Condition)) + 
    geom_errorbar(aes(ymin=Total_crash-ci, ymax=Total_crash+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   Gender  N Total_crash        sd        se        ci
## 1      F 10   0.6000000 0.5163978 0.1632993 0.3694087
## 2      M 34   0.5294118 0.8611231 0.1476814 0.3004601
# Use 95% confidence interval instead of SEM
plot2 <- ggplot(tgc, aes(x=Gender, y=Total_crash, colour=Gender)) + 
    geom_errorbar(aes(ymin=Total_crash-ci, ymax=Total_crash+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   ComputerGames  N Total_crash        sd        se        ci
## 1           0-2 19   0.7368421 0.9334586 0.2141501 0.4499127
## 2           3-5 13   0.4615385 0.6602253 0.1831135 0.3989702
## 3            5+ 12   0.3333333 0.6513389 0.1880254 0.4138410
# Use 95% confidence interval instead of SEM
plot3 <- ggplot(tgc, aes(x=ComputerGames, y=Total_crash, colour=ComputerGames)) + 
    geom_errorbar(aes(ymin=Total_crash-ci, ymax=Total_crash+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##    YearDriversLicence N Total_crash        sd        se        ci
## 1            1.833333 1   0.0000000        NA        NA       NaN
## 2            2.000000 3   0.6666667 1.1547005 0.6666667 2.8684352
## 3            2.416667 1   3.0000000        NA        NA       NaN
## 4            2.666667 1   1.0000000        NA        NA       NaN
## 5            2.833333 1   0.0000000        NA        NA       NaN
## 6            3.000000 2   0.0000000 0.0000000 0.0000000 0.0000000
## 7            3.333333 1   0.0000000        NA        NA       NaN
## 8            3.416667 1   0.0000000        NA        NA       NaN
## 9            3.500000 1   0.0000000        NA        NA       NaN
## 10           4.000000 7   0.8571429 0.6900656 0.2608203 0.6382042
## 11           4.250000 1   0.0000000        NA        NA       NaN
## 12           4.416667 3   0.3333333 0.5773503 0.3333333 1.4342176
## 13           4.500000 2   0.5000000 0.7071068 0.5000000 6.3531024
## 14           4.666667 1   0.0000000        NA        NA       NaN
## 15           5.000000 6   0.5000000 0.5477226 0.2236068 0.5747996
## 16           5.416667 3   0.3333333 0.5773503 0.3333333 1.4342176
## 17           5.916667 1   1.0000000        NA        NA       NaN
## 18           6.000000 2   0.0000000 0.0000000 0.0000000 0.0000000
## 19           6.083333 1   0.0000000        NA        NA       NaN
## 20           6.666667 1   0.0000000        NA        NA       NaN
## 21           7.000000 1   1.0000000        NA        NA       NaN
## 22           9.000000 1   0.0000000        NA        NA       NaN
## 23          10.166667 1   3.0000000        NA        NA       NaN
## 24          16.000000 1   1.0000000        NA        NA       NaN
  #Use 95% confidence interval instead of SEM
  plot4 <- ggplot(tgc, aes(x=YearDriversLicence, y=Total_crash, colour=YearDriversLicence)) + 
      geom_errorbar(aes(ymin=Total_crash-ci, ymax=Total_crash+ci), width=.1, position=pd) +
      geom_line(position=pd) +
      geom_point(position=pd)
##   SimulatorExperience  N Total_crash        sd        se        ci
## 1                  No 34   0.5882353 0.8208513 0.1407748 0.2864085
## 2                 Yes 10   0.4000000 0.6992059 0.2211083 0.5001818
# Use 95% confidence interval instead of SEM
plot5 <- ggplot(tgc, aes(x=SimulatorExperience, y=Total_crash, colour=SimulatorExperience)) + 
    geom_errorbar(aes(ymin=Total_crash-ci, ymax=Total_crash+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   Automatic  N Total_crash        sd         se        ci
## 1        No 13   1.0000000 1.1547005 0.32025631 0.6977786
## 2       Yes 31   0.3548387 0.4863735 0.08735525 0.1784032
# Use 95% confidence interval instead of SEM
plot6 <- ggplot(tgc, aes(x=Automatic, y=Total_crash, colour=Automatic)) + 
    geom_errorbar(aes(ymin=Total_crash-ci, ymax=Total_crash+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
  SaveSixPlots("Total_crash")

Lane Breaks

##     Condition  N Lane_Breaks       sd        se       ci
## 1     Acrylic 11    3.636364 3.074824 0.9270945 2.065695
## 2         Bar 11    4.454545 4.590504 1.3840890 3.083943
## 3 Combination 11    3.909091 2.625054 0.7914836 1.763535
## 4  Touch_only 11    3.818182 2.750207 0.8292185 1.847614
# Use 95% confidence interval instead of SEM
plot1 <- ggplot(tgc, aes(x=Condition, y=Lane_Breaks, colour=Condition)) + 
    geom_errorbar(aes(ymin=Lane_Breaks-ci, ymax=Lane_Breaks+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   Gender  N Lane_Breaks       sd        se       ci
## 1      F 10    4.300000 2.626785 0.8306624 1.879089
## 2      M 34    3.852941 3.438925 0.5897707 1.199898
# Use 95% confidence interval instead of SEM
plot2 <- ggplot(tgc, aes(x=Gender, y=Lane_Breaks, colour=Gender)) + 
    geom_errorbar(aes(ymin=Lane_Breaks-ci, ymax=Lane_Breaks+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   ComputerGames  N Lane_Breaks       sd       se       ci
## 1           0-2 19    4.421053 2.243900 0.514786 1.081525
## 2           3-5 13    3.769231 3.745082 1.038699 2.263131
## 3            5+ 12    3.416667 4.122187 1.189973 2.619113
# Use 95% confidence interval instead of SEM
plot3 <- ggplot(tgc, aes(x=ComputerGames, y=Lane_Breaks, colour=ComputerGames)) + 
    geom_errorbar(aes(ymin=Lane_Breaks-ci, ymax=Lane_Breaks+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##    YearDriversLicence N Lane_Breaks        sd        se        ci
## 1            1.833333 1    6.000000        NA        NA       NaN
## 2            2.000000 3    6.666667 7.6376262 4.4095855 18.972915
## 3            2.416667 1    6.000000        NA        NA       NaN
## 4            2.666667 1    6.000000        NA        NA       NaN
## 5            2.833333 1    1.000000        NA        NA       NaN
## 6            3.000000 2    1.000000 1.4142136 1.0000000 12.706205
## 7            3.333333 1    8.000000        NA        NA       NaN
## 8            3.416667 1    2.000000        NA        NA       NaN
## 9            3.500000 1    1.000000        NA        NA       NaN
## 10           4.000000 7    3.857143 3.2366944 1.2233555  2.993443
## 11           4.250000 1    7.000000        NA        NA       NaN
## 12           4.416667 3    4.000000 4.5825757 2.6457513 11.383749
## 13           4.500000 2    3.000000 1.4142136 1.0000000 12.706205
## 14           4.666667 1    2.000000        NA        NA       NaN
## 15           5.000000 6    2.333333 1.7511901 0.7149204  1.837761
## 16           5.416667 3    3.666667 0.5773503 0.3333333  1.434218
## 17           5.916667 1    2.000000        NA        NA       NaN
## 18           6.000000 2    3.000000 1.4142136 1.0000000 12.706205
## 19           6.083333 1    6.000000        NA        NA       NaN
## 20           6.666667 1    5.000000        NA        NA       NaN
## 21           7.000000 1   10.000000        NA        NA       NaN
## 22           9.000000 1    0.000000        NA        NA       NaN
## 23          10.166667 1    5.000000        NA        NA       NaN
## 24          16.000000 1    9.000000        NA        NA       NaN
  #Use 95% confidence interval instead of SEM
  plot4 <- ggplot(tgc, aes(x=YearDriversLicence, y=Lane_Breaks, colour=YearDriversLicence)) + 
      geom_errorbar(aes(ymin=Lane_Breaks-ci, ymax=Lane_Breaks+ci), width=.1, position=pd) +
      geom_line(position=pd) +
      geom_point(position=pd)
##   SimulatorExperience  N Lane_Breaks       sd        se        ci
## 1                  No 34    4.058824 2.533906 0.4345612 0.8841214
## 2                 Yes 10    3.600000 5.168279 1.6343534 3.6971643
# Use 95% confidence interval instead of SEM
plot5<- ggplot(tgc, aes(x=SimulatorExperience, y=Lane_Breaks, colour=SimulatorExperience)) + 
    geom_errorbar(aes(ymin=Lane_Breaks-ci, ymax=Lane_Breaks+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   Automatic  N Lane_Breaks       sd        se        ci
## 1        No 13    6.076923 3.729646 1.0344176 2.2538023
## 2       Yes 31    3.064516 2.606856 0.4682052 0.9562026
# Use 95% confidence interval instead of SEM
plot6<- ggplot(tgc, aes(x=Automatic, y=Lane_Breaks, colour=Automatic)) + 
    geom_errorbar(aes(ymin=Lane_Breaks-ci, ymax=Lane_Breaks+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
  SaveSixPlots("Lane_Breaks")

Total Glances

##     Condition  N Total_Glances        sd       se       ci
## 1     Acrylic 11      45.27273 12.042350 3.630905 8.090160
## 2         Bar 11      47.18182  6.274045 1.891696 4.214961
## 3 Combination 11      55.00000 13.798551 4.160420 9.269992
## 4  Touch_only 11      45.27273  7.156688 2.157823 4.807928
# Use 95% confidence interval instead of SEM
plot1<- ggplot(tgc, aes(x=Condition, y=Total_Glances, colour=Condition)) + 
    geom_errorbar(aes(ymin=Total_Glances-ci, ymax=Total_Glances+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   Gender  N Total_Glances       sd       se       ci
## 1      F 10      52.40000  7.07421 2.237062 5.060585
## 2      M 34      46.94118 11.39894 1.954902 3.977278
# Use 95% confidence interval instead of SEM
plot2<- ggplot(tgc, aes(x=Gender, y=Total_Glances, colour=Gender)) + 
    geom_errorbar(aes(ymin=Total_Glances-ci, ymax=Total_Glances+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   ComputerGames  N Total_Glances        sd       se       ci
## 1           0-2 19      49.52632 11.393802 2.613917 5.491637
## 2           3-5 13      48.07692 12.311658 3.414640 7.439860
## 3            5+ 12      46.16667  8.144528 2.351123 5.174786
# Use 95% confidence interval instead of SEM
plot3<- ggplot(tgc, aes(x=ComputerGames, y=Total_Glances, colour=ComputerGames)) + 
    geom_errorbar(aes(ymin=Total_Glances-ci, ymax=Total_Glances+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##    YearDriversLicence N Total_Glances        sd       se        ci
## 1            1.833333 1      63.00000        NA       NA       NaN
## 2            2.000000 3      50.00000  2.000000 1.154701  4.968275
## 3            2.416667 1      38.00000        NA       NA       NaN
## 4            2.666667 1      50.00000        NA       NA       NaN
## 5            2.833333 1      42.00000        NA       NA       NaN
## 6            3.000000 2      49.00000  0.000000 0.000000  0.000000
## 7            3.333333 1      49.00000        NA       NA       NaN
## 8            3.416667 1      80.00000        NA       NA       NaN
## 9            3.500000 1      41.00000        NA       NA       NaN
## 10           4.000000 7      48.57143 13.794409 5.213796 12.757700
## 11           4.250000 1      54.00000        NA       NA       NaN
## 12           4.416667 3      46.00000  6.557439 3.785939 16.289580
## 13           4.500000 2      50.00000  2.828427 2.000000 25.412409
## 14           4.666667 1      32.00000        NA       NA       NaN
## 15           5.000000 6      50.66667  8.936815 3.648440  9.378612
## 16           5.416667 3      43.66667 16.165808 9.333333 40.158092
## 17           5.916667 1      35.00000        NA       NA       NaN
## 18           6.000000 2      49.50000  9.192388 6.500000 82.590331
## 19           6.083333 1      31.00000        NA       NA       NaN
## 20           6.666667 1      50.00000        NA       NA       NaN
## 21           7.000000 1      37.00000        NA       NA       NaN
## 22           9.000000 1      45.00000        NA       NA       NaN
## 23          10.166667 1      64.00000        NA       NA       NaN
## 24          16.000000 1      49.00000        NA       NA       NaN
  #Use 95% confidence interval instead of SEM
  plot4<- ggplot(tgc, aes(x=YearDriversLicence, y=Total_Glances, colour=YearDriversLicence)) + 
      geom_errorbar(aes(ymin=Total_Glances-ci, ymax=Total_Glances+ci), width=.1, position=pd) +
      geom_line(position=pd) +
      geom_point(position=pd)
##   SimulatorExperience  N Total_Glances        sd       se       ci
## 1                  No 34      49.32353 11.104792 1.904456 3.874645
## 2                 Yes 10      44.30000  8.844961 2.797022 6.327304
# Use 95% confidence interval instead of SEM
plot5<- ggplot(tgc, aes(x=SimulatorExperience, y=Total_Glances, colour=SimulatorExperience)) + 
    geom_errorbar(aes(ymin=Total_Glances-ci, ymax=Total_Glances+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   Automatic  N Total_Glances       sd       se       ci
## 1        No 13      53.00000 11.28421 3.129676 6.818978
## 2       Yes 31      46.16129 10.02030 1.799699 3.675476
# Use 95% confidence interval instead of SEM
plot6<- ggplot(tgc, aes(x=Automatic, y=Total_Glances, colour=Automatic)) + 
    geom_errorbar(aes(ymin=Total_Glances-ci, ymax=Total_Glances+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
  SaveSixPlots("Total_Glances")

### Total Glance time

##     Condition  N Total_Glance_time        sd       se       ci
## 1     Acrylic 11          34.18545 10.471866 3.157387 7.035096
## 2         Bar 11          34.71636  7.799066 2.351507 5.239484
## 3 Combination 11          40.01091 10.989521 3.313465 7.382861
## 4  Touch_only 11          38.80273 10.009391 3.017945 6.724400
# Use 95% confidence interval instead of SEM
plot1<- ggplot(tgc, aes(x=Condition, y=Total_Glance_time, colour=Condition)) + 
    geom_errorbar(aes(ymin=Total_Glance_time-ci, ymax=Total_Glance_time+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   Gender  N Total_Glance_time        sd       se       ci
## 1      F 10          38.97100 11.813748 3.735835 8.451046
## 2      M 34          36.32824  9.348681 1.603285 3.261909
# Use 95% confidence interval instead of SEM
plot2<- ggplot(tgc, aes(x=Gender, y=Total_Glance_time, colour=Gender)) + 
    geom_errorbar(aes(ymin=Total_Glance_time-ci, ymax=Total_Glance_time+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   ComputerGames  N Total_Glance_time        sd       se       ci
## 1           0-2 19          37.70316  9.917291 2.275183 4.779981
## 2           3-5 13          38.78154 10.858993 3.011743 6.562024
## 3            5+ 12          33.69583  8.672715 2.503597 5.510380
# Use 95% confidence interval instead of SEM
plot3<- ggplot(tgc, aes(x=ComputerGames, y=Total_Glance_time, colour=ComputerGames)) + 
    geom_errorbar(aes(ymin=Total_Glance_time-ci, ymax=Total_Glance_time+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##    YearDriversLicence N Total_Glance_time        sd       se        ci
## 1            1.833333 1          60.01000        NA       NA       NaN
## 2            2.000000 3          39.87000  6.453658 3.726021 16.031775
## 3            2.416667 1          39.85000        NA       NA       NaN
## 4            2.666667 1          41.51000        NA       NA       NaN
## 5            2.833333 1          28.82000        NA       NA       NaN
## 6            3.000000 2          37.68500  3.825448 2.705000 34.370284
## 7            3.333333 1          40.31000        NA       NA       NaN
## 8            3.416667 1          55.23000        NA       NA       NaN
## 9            3.500000 1          21.06000        NA       NA       NaN
## 10           4.000000 7          34.51857  9.073947 3.429630  8.392001
## 11           4.250000 1          39.58000        NA       NA       NaN
## 12           4.416667 3          46.04000 11.615029 6.705940 28.853332
## 13           4.500000 2          39.12500  6.936718 4.905000 62.323934
## 14           4.666667 1          23.96000        NA       NA       NaN
## 15           5.000000 6          34.95000 12.078306 4.930948 12.675405
## 16           5.416667 3          36.14333 11.712823 6.762402 29.096266
## 17           5.916667 1          25.21000        NA       NA       NaN
## 18           6.000000 2          31.02500  4.320422 3.055000 38.817455
## 19           6.083333 1          25.86000        NA       NA       NaN
## 20           6.666667 1          38.10000        NA       NA       NaN
## 21           7.000000 1          36.27000        NA       NA       NaN
## 22           9.000000 1          28.22000        NA       NA       NaN
## 23          10.166667 1          45.49000        NA       NA       NaN
## 24          16.000000 1          42.23000        NA       NA       NaN
# Use 95% confidence interval instead of SEM
  plot4<- ggplot(tgc, aes(x=YearDriversLicence, y=Total_Glance_time, colour=YearDriversLicence)) + 
      geom_errorbar(aes(ymin=Total_Glance_time-ci, ymax=Total_Glance_time+ci), width=.1, position=pd) +
      geom_line(position=pd) +
      geom_point(position=pd)
##   SimulatorExperience  N Total_Glance_time        sd       se       ci
## 1                  No 34          37.86588  9.488498 1.627264 3.310693
## 2                 Yes 10          33.74300 11.014066 3.482953 7.878988
# Use 95% confidence interval instead of SEM
plot5<- ggplot(tgc, aes(x=SimulatorExperience, y=Total_Glance_time, colour=SimulatorExperience)) + 
    geom_errorbar(aes(ymin=Total_Glance_time-ci, ymax=Total_Glance_time+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
##   Automatic  N Total_Glance_time       sd       se       ci
## 1        No 13          43.09308 8.857234 2.456555 5.352373
## 2       Yes 31          34.34387 9.222538 1.656417 3.382854
# Use 95% confidence interval instead of SEM
plot6<- ggplot(tgc, aes(x=Automatic, y=Total_Glance_time, colour=Automatic)) + 
    geom_errorbar(aes(ymin=Total_Glance_time-ci, ymax=Total_Glance_time+ci), width=.1, position=pd) +
    geom_line(position=pd) +
    geom_point(position=pd)
  SaveSixPlots("Total_Glance_Time")

Boxplots

library(ggplot2)
SusCondition=ggplot(data=SartSusDemo, mapping=aes(x=Condition, y=SUS,fill = Condition))+geom_boxplot()
SartCondition=ggplot(data=SartSusDemo, mapping=aes(x=Condition, y=SART,fill = Condition))+geom_boxplot()
SusGender=ggplot(data=SartSusDemo, mapping=aes(x=Gender, y=SUS,fill = Gender))+geom_boxplot()
SartGender=ggplot(data=SartSusDemo, mapping=aes(x=Gender, y=SART,fill = Gender))+geom_boxplot()
SusComputerGames=ggplot(data=SartSusDemo, mapping=aes(x=ComputerGames, y=SUS,fill = ComputerGames))+geom_boxplot()
SartComputerGames=ggplot(data=SartSusDemo, mapping=aes(x=ComputerGames, y=SART,fill = ComputerGames))+geom_boxplot()

SusCondition

SartCondition

SusGender

SartGender

SusComputerGames

SartComputerGames

##T-tests

Combi <- SartSusDemo[which(SartSusDemo$Condition=='Combination'),]
Touch <- SartSusDemo[which(SartSusDemo$Condition=='Touch_only'),]
Bar <- SartSusDemo[which(SartSusDemo$Condition=='Bar'),]
Acrylic <- SartSusDemo[which(SartSusDemo$Condition=='Acrylic'),]

CombiTouch <- subset(SartSusDemo, Condition=='Combination' | Condition=='Touch_only', 
select=c(Participants, SUS,Condition))


TSusCondition = t.test(formula = SUS ~ Condition, data = CombiTouch)
TSusCondition
## 
##  Welch Two Sample t-test
## 
## data:  SUS by Condition
## t = 0.96386, df = 19.562, p-value = 0.3469
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -6.366993 17.276084
## sample estimates:
## mean in group Combination  mean in group Touch_only 
##                  80.45455                  75.00000
one.way <- aov(SUS ~ Condition, data = SartSusDemo)
summary(one.way)
##             Df Sum Sq Mean Sq F value Pr(>F)
## Condition    3    267   89.16   0.589  0.626
## Residuals   40   6052  151.31
TSusGender = t.test(formula = SUS ~ Gender, data = SartSusDemo)
TSartGender = t.test(formula = SART ~ Gender, data = SartSusDemo)

TSusGender
## 
##  Welch Two Sample t-test
## 
## data:  SUS by Gender
## t = -0.42818, df = 13.983, p-value = 0.675
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -11.754163   7.842398
## sample estimates:
## mean in group F mean in group M 
##        77.75000        79.70588
TSartGender
## 
##  Welch Two Sample t-test
## 
## data:  SART by Gender
## t = -2.4169, df = 17.261, p-value = 0.02699
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -5.9791715 -0.4090638
## sample estimates:
## mean in group F mean in group M 
##        12.10000        15.29412

Hypoteser

  1. Der er forskel mellem aid og no aid
  2. Én aid er bedre end de andre
  3. Hvor meget man spiller computerspil har en indflydelse på hvor godt man kører
  4. Lange glances leder til flere crashes eller swerves
  5. Køreevne er forskellige mellem mænd og kvinder

Datavisualisering

Plot of means eller Boxplot Overblik over alle forskellige produkt metrics og aid konditioner

For hver aid kondition: * Total glance time * Glances per task * Total glances * Total lane breaks * Total crashes * SUS * SART

Aid kondition på x-akse, metric på y-akse

Hvis vi laver alle plots i samme rækkefølge kan vi lave et stort grid af plots for nem sammenligning på tværs af metrics og konditioner.

Test

Hvilke test skal vi lave på hvilke metrics for hver af de mulige hypoteser

Én aid er bedre end no aid og de andre aids

Variabler Independent variable: * kondition Dependent variables: (Kan ville lægge alle dem her sammen på en måde? Altså en samlet kørescore) * Total glance time * Glances per task * Total glances * Total lane breaks * Total crashes

Signifikans test * ANOVA på alle køre metrics for hver kondition (Det bliver mange tal) * ANOVA på SUS score for hver kondition * ANOVA på SART score for hver kondition

Alpha inflation korrektion Benjamini–Hochberg adjustment (Benjamini and Hochberg, 1995) (Sauro & Lewis, 2016 p. 266). Det er en mindre konservativ korrektion end Bon Ferroni så der er større change for at finde en effekt men vi korrigere stadig for gentagne test (alpha inflation).

Lange glances leder til crash eller swerve

Independent variable: * GT>1.5 * TGT>12

Dependent variables:

Hvor meget man spiller computerspil har en indflydelse på hvor godt man kører

Independent variable: * Over / under 5 timer gaming om ugen (5+ / 5-)

Dependent variables: * Total crashes * Total lane breaks

ANOVA på om 5- er anderledes end 5+ og om der er interaktion mellem Crash og lane break

# Requirements ### 12 sek glance per opgave Mean total glance time for hver opgave. Vi skal sortere i de opgaver der ikke kan bruges til noget her. Det vil måske være lidt useless fordi de dybere opgaver ikke er færdige nok til at teste på.

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.